package com.taobao.api.request;

import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.TaobaoObject;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.json.JSONWriter;
import com.taobao.api.response.CainiaoSmartdeliveryCocpsIQueryResponse;

/**
 * TOP API: cainiao.smartdelivery.cocps.i.query request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class CainiaoSmartdeliveryCocpsIQueryRequest extends BaseTaobaoRequest<CainiaoSmartdeliveryCocpsIQueryResponse> {
	
	

	/** 
	* 发货地址
	 */
	private String sendAddress;

	public void setSendAddress(String sendAddress) {
		this.sendAddress = sendAddress;
	}

	public void setSendAddress(Address sendAddress) {
		this.sendAddress = new JSONWriter(false,true).write(sendAddress);
	}

	public String getSendAddress() {
		return this.sendAddress;
	}

	public String getApiMethodName() {
		return "cainiao.smartdelivery.cocps.i.query";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("send_address", this.sendAddress);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<CainiaoSmartdeliveryCocpsIQueryResponse> getResponseClass() {
		return CainiaoSmartdeliveryCocpsIQueryResponse.class;
	}

	public void check() throws ApiRuleException {
	}
	
	/**
 * 发货地址
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class Address extends TaobaoObject {

	private static final long serialVersionUID = 1147383975565675415L;

	/**
		 * 市
		 */
		@ApiField("city")
		private String city;
		/**
		 * 详细信息
		 */
		@ApiField("detail")
		private String detail;
		/**
		 * 区
		 */
		@ApiField("district")
		private String district;
		/**
		 * 省
		 */
		@ApiField("province")
		private String province;
		/**
		 * 街道
		 */
		@ApiField("town")
		private String town;
	

	public String getCity() {
			return this.city;
		}
		public void setCity(String city) {
			this.city = city;
		}
		public String getDetail() {
			return this.detail;
		}
		public void setDetail(String detail) {
			this.detail = detail;
		}
		public String getDistrict() {
			return this.district;
		}
		public void setDistrict(String district) {
			this.district = district;
		}
		public String getProvince() {
			return this.province;
		}
		public void setProvince(String province) {
			this.province = province;
		}
		public String getTown() {
			return this.town;
		}
		public void setTown(String town) {
			this.town = town;
		}

}


}